﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using MinhTam.DataAccess.Web;
using MinhTam.Objects;

public partial class vanphongchitiet : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            loadData();
        }
        
    }
    private void loadData()
    {
        try
        {
            string vpid = Request.QueryString["id"];
            DataTable dt = VAN_PHONG.GetTableAll(VAN_PHONG.cl_VAN_PHONG_ID + "=" + vpid);
            if (dt == null || dt.Rows.Count == 0)
            {
                tblData.Visible = false;
                return;

            }
            lblTenVanPhong.Text = dt.Rows[0][VAN_PHONG.cl_TEN_VAN_PHONG].ToString();
            lblDiaChi.Text = dt.Rows[0][VAN_PHONG.cl_DIA_CHI].ToString();
            lblDienThoai.Text = dt.Rows[0][VAN_PHONG.cl_DIEN_THOAI].ToString();
            lblFax.Text = dt.Rows[0][VAN_PHONG.cl_FAX].ToString();
            lblMoTa.Text = dt.Rows[0][VAN_PHONG.cl_MO_TA].ToString();
            lblMap.Text = dt.Rows[0][VAN_PHONG.cl_MAP_URL].ToString();
            if (lblMap.Text == "") lblMap.Visible = false;
        }
        catch
        {
            tblData.Visible = false;

        }
    }
}